﻿using System.Collections.Generic;
using System.Threading.Tasks;
using BCEntity.TMS.VehicleCategoryReference;

namespace BCData.TMS.VehicleCategoryReference
{
    /// <summary>
    /// 车型分类对应表数据库操作
    /// </summary>
    public interface IVehicleCategoryReferenceData
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> InserAsync(List<VehicleCategoryReferenceEntity> entity);

        /// <summary>
        /// 单条insert
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> SingleInsertAsync(VehicleCategoryReferenceEntity entity);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> UpdateAsync(List<VehicleCategoryReferenceEntity> entity);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="vehiclecategoryreferenceId"></param>
        /// <returns></returns>
        Task<int> DeleteAsync(int vehiclecategoryreferenceId);

        /// <summary>
        /// 通过车辆类型id删除
        /// </summary>
        /// <param name="vehicleTypeId">车辆类型id</param>
        /// <returns></returns>
        Task<int> DeleteByVehicleTypeIdAsync(int vehicleTypeId);

        /// <summary>
        /// 通过车辆类型id和车型分类查询
        /// </summary>
        /// <param name="vehicleTypeId"></param>
        /// <param name="vehicleCategory"></param>
        /// <returns></returns>
        Task<VehicleCategoryReferenceEntity> GetAsync(int vehicleTypeId, string vehicleCategory);

        /// <summary>
        /// 读取车辆所属分类列表
        /// </summary>
        /// <param name="vehicleTypeId"></param>
        /// <param name="vehicleCategory"></param>
        /// <returns></returns>
        Task<IEnumerable<VehicleCategoryReferenceExpandEntity>> GetByVehicleTypeId(int? vehicleTypeId = null, string vehicleCategory = "");

        /// <summary>
        /// 查询全部
        /// </summary>
        /// <returns></returns>
        Task<(IEnumerable<VehicleCategoryReferenceExpandEntity>, int)> GetAll(int pageIndex, int pageSize);

        /// <summary>
        /// 获取车辆所属分类映射信息
        /// </summary>
        /// <param name="vehicleCategoryReferenceId">车辆所属分类映射Id</param>
        /// <returns></returns>
        Task<VehicleCategoryReferenceExpandEntity> GetById(int vehicleCategoryReferenceId);

        #region 获取车型分类

        /// <summary>
        /// 获取车型分类
        /// </summary>
        /// <param name="vehicleTypeId">车型Id</param>
        /// <returns></returns>
        Task<IEnumerable<VehicleCategoryReferenceExpandEntity>> GetVehicleCategoryReferenceExpandEntity(int vehicleTypeId);

        /// <summary>
        /// 获取全部车型分类
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<VehicleCategoryReferenceExpandEntity>> GetCategoryReferenceList(int? vehicleTypeId);

        #endregion 获取车型分类
        /// <summary>
        /// 切换车型分类
        /// </summary>
        /// <param name="vehicleCategoryReferenceId">车型分类引用Id</param>
        /// <param name="vehicleTypeId">车辆类型Id</param>
        /// <returns></returns>
        Task<VehicleCategoryReferenceEntity> SwitchCategory(int vehicleCategoryReferenceId, int vehicleTypeId);
    }
}